<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            color:yellow;
        }
    </style>

    <script src="./react/react.development.js"></script>
    <script src="./react/react-dom.development.js"></script>
    <script src="./react/babel.min.js"></script>
</head>
<body>
<div id="app"></div>
<script type="text/babel">

    //JSX=JS+xml、


    let app = document.querySelector('#app');
    let root = ReactDOM.createRoot(app);

    let data = [
        { id: 1, text: 'aaa' },
        { id: 2, text: 'bbb' },
        { id: 3, text: 'ccc' }
    ];

    let data2 = [
        { id: 4, text: 'aaa' },
        { id: 5, text: 'bbb' },
        { id: 6, text: 'ccc' }
    ];

    let element = (
        <ul>
            {
                data.map(v=><li key={v.id}>{v.id},{v.text}</li>)
            }
        </ul>
    );

    let element1 = (
        <ul>
            {
                data2.map((v)=>{
                  return <li key={v.id}>{v.id},{v.text}</li>
                })
            }
        </ul>
    );

    root.render(element);
    root.render(element1);


</script>
</body>
</html>